﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace JM.JCY.SharePointComponent.CaseManagement.CaseManagementLeftMenu
{
    public partial class CaseManagementLeftMenuUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string sourceDirectory = this.Parent.AppRelativeTemplateSourceDirectory;    //Example:   ~/_CONTROLTEMPLATES/JM.OCP.SharePointComponent.Broadcast/CreateBroadcastsRole/
            string webPartName = sourceDirectory.Substring(sourceDirectory.TrimEnd('/').LastIndexOf('/') + 1).TrimEnd('/');

            switch (webPartName)
            {

                case "CaseAllProcess":
                    lbCaseAllProcess.CssClass = "leftmenuSelected";
                    break;


                case "CaseDepartmentCase":
                    lbCaseDepartmentCase.CssClass = "leftmenuSelected";
                    break;


                case "CaseKeyPoint":
                    lbCaseKeyPoint.CssClass = "leftmenuSelected";
                    break;

                case "CaseSearch":
                    lbCaseSearch.CssClass = "leftmenuSelected";
                    break;


                case "CaseWarning":
                    lbCaseWarning.CssClass = "leftmenuSelected";
                    break;

              



            }

            if (!IsPostBack)
            {
                //SetLeftMenuVisibility(pageName);
            }
        }
    }
}
